<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../js/jquery.min.js"></script>
    <script>
        $(function(){
            $("#btn").click(function(){
                // console.log($("input[name='username']").val());
                // console.log($("input[name='password']").val());
                // console.log($("input[name='phone']").val());
                // console.log($("input[name='address']").val());


                // username=aaa&password=111&phone=111111&address=aaa
                console.log($("#form").serialize());

            });
        });
    </script>
</head>
<body>
    <form action="./09.遍历jQuery对象.html" id="form">
        用户: <input type="text" name="username">
        <br>
        密码: <input type="password" name="password">
        <br>
        电话: <input type="text" name="phone">
        <br>
        地址: <input type="text" name="address">
        <br>
        <input type="submit">
        <br>
        <input type="button" value="按钮" id="btn">
    </form>
</body>
</html>